import Vue from 'vue'
import ElementUI from 'element-ui';
import ygbh from 'ygbh';
import 'element-ui/lib/theme-chalk/index.css';
import 'ygbh/ygbh.css';
import './App.less';
import App from './App.vue'
import router from './router'
import Api from '@/common/Api'
import successCode from '@/common/successCode'
import Select from '@/components/Select.vue'
import store from './store'
import storeTest from './store/storeTest'

console.log(ygbh);
Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(ygbh);
Vue.prototype.Api = Api;
Vue.prototype.statusCode = successCode;
console.log(store);
console.log(storeTest);
console.log(Select);


//let mystore = new MyStore();
// 路由守卫
router.beforeEach((to, from, next) => {
	// console.log('beforeEach:全局守卫')
	// console.log('to:', to);
	// console.log('from:', from);
	if(to.name == 'Home' && true) {//某种条件行,不能进入 Home 路由
		//return;
	}
	next();
});

window.addEventListener('popstate',function (e) {
	console.log('popstate', e);
	console.log('popstate.state', e.state);
}, false);

const myVm = new Vue({
	router,
	store,
	storeTest,
	components: {
		//'test-select': Select,
	},
	render: h => h(App)
}).$mount('#app')
console.log(myVm);